﻿@using StackExchange.Opserver.Data.Redis
@model RedisInstance
@{
    Layout = null;
    var info = Model;
    var clients = info.Clients.SafeData();
}
@if (clients != null)
{
    <div class="info-title">Client Summary <span class="note">(by name)</span></div>
    <div class="redis-client-summary">
        @{ var names = clients.GroupBy(c => c.Name); }
        @foreach (var name in names.OrderByDescending(n => n.Count()).ThenBy(n => n.Key))
        {
            <div class="info-line"><span class="label">@name.Key.IsNullOrEmptyReturn("Unknown")</span> <span class="value">@name.Count().ToComma()</span> <span class="value add-info conns">@name.Count().Pluralize("connection", includeNumber: false)</span></div>
        }
    </div>
}